3.2.16 \(\int \frac {A+B x^2}{a-b x^2} \, dx\)

Optimal. Leaf size=39 \[ \frac {(a B+A b) \tanh ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}-\frac {B x}{b} \]

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {388, 208} \begin {gather*} \frac {(a B+A b) \tanh ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}-\frac {B x}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A + B*x^2)/(a - b*x^2),x]

[Out]

-((B*x)/b) + ((A*b + a*B)*ArcTanh[(Sqrt[b]*x)/Sqrt[a]])/(Sqrt[a]*b^(3/2))

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps

\begin {align*} \int \frac {A+B x^2}{a-b x^2} \, dx &=-\frac {B x}{b}+\frac {(A b+a B) \int \frac {1}{a-b x^2} \, dx}{b}\\ &=-\frac {B x}{b}+\frac {(A b+a B) \tanh ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 39, normalized size = 1.00 \begin {gather*} \frac {(a B+A b) \tanh ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}-\frac {B x}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x^2)/(a - b*x^2),x]

[Out]

-((B*x)/b) + ((A*b + a*B)*ArcTanh[(Sqrt[b]*x)/Sqrt[a]])/(Sqrt[a]*b^(3/2))

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A+B x^2}{a-b x^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(A + B*x^2)/(a - b*x^2),x]

[Out]

IntegrateAlgebraic[(A + B*x^2)/(a - b*x^2), x]

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 98, normalized size = 2.51 \begin {gather*} \left [-\frac {2 \, B a b x - {\left (B a + A b\right )} \sqrt {a b} \log \left (\frac {b x^{2} + 2 \, \sqrt {a b} x + a}{b x^{2} - a}\right )}{2 \, a b^{2}}, -\frac {B a b x + {\left (B a + A b\right )} \sqrt {-a b} \arctan \left (\frac {\sqrt {-a b} x}{a}\right )}{a b^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x^2+A)/(-b*x^2+a),x, algorithm="fricas")

[Out]

[-1/2*(2*B*a*b*x - (B*a + A*b)*sqrt(a*b)*log((b*x^2 + 2*sqrt(a*b)*x + a)/(b*x^2 - a)))/(a*b^2), -(B*a*b*x + (B
*a + A*b)*sqrt(-a*b)*arctan(sqrt(-a*b)*x/a))/(a*b^2)]

________________________________________________________________________________________

giac [A]  time = 0.29, size = 36, normalized size = 0.92 \begin {gather*} -\frac {B x}{b} - \frac {{\left (B a + A b\right )} \arctan \left (\frac {b x}{\sqrt {-a b}}\right )}{\sqrt {-a b} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x^2+A)/(-b*x^2+a),x, algorithm="giac")

[Out]

-B*x/b - (B*a + A*b)*arctan(b*x/sqrt(-a*b))/(sqrt(-a*b)*b)

________________________________________________________________________________________

maple [A]  time = 0.00, size = 37, normalized size = 0.95 \begin {gather*} -\frac {B x}{b}-\frac {\left (-A b -B a \right ) \arctanh \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b}\, b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x^2+A)/(-b*x^2+a),x)

[Out]

-B/b*x-(-A*b-B*a)/b/(a*b)^(1/2)*arctanh(1/(a*b)^(1/2)*b*x)

________________________________________________________________________________________

maxima [A]  time = 2.42, size = 49, normalized size = 1.26 \begin {gather*} -\frac {B x}{b} - \frac {{\left (B a + A b\right )} \log \left (\frac {b x - \sqrt {a b}}{b x + \sqrt {a b}}\right )}{2 \, \sqrt {a b} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x^2+A)/(-b*x^2+a),x, algorithm="maxima")

[Out]

-B*x/b - 1/2*(B*a + A*b)*log((b*x - sqrt(a*b))/(b*x + sqrt(a*b)))/(sqrt(a*b)*b)

________________________________________________________________________________________

mupad [B]  time = 0.14, size = 31, normalized size = 0.79 \begin {gather*} \frac {\mathrm {atanh}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )\,\left (A\,b+B\,a\right )}{\sqrt {a}\,b^{3/2}}-\frac {B\,x}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*x^2)/(a - b*x^2),x)

[Out]

(atanh((b^(1/2)*x)/a^(1/2))*(A*b + B*a))/(a^(1/2)*b^(3/2)) - (B*x)/b

________________________________________________________________________________________

sympy [B]  time = 0.29, size = 75, normalized size = 1.92 \begin {gather*} - \frac {B x}{b} - \frac {\sqrt {\frac {1}{a b^{3}}} \left (A b + B a\right ) \log {\left (- a b \sqrt {\frac {1}{a b^{3}}} + x \right )}}{2} + \frac {\sqrt {\frac {1}{a b^{3}}} \left (A b + B a\right ) \log {\left (a b \sqrt {\frac {1}{a b^{3}}} + x \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x**2+A)/(-b*x**2+a),x)

[Out]

-B*x/b - sqrt(1/(a*b**3))*(A*b + B*a)*log(-a*b*sqrt(1/(a*b**3)) + x)/2 + sqrt(1/(a*b**3))*(A*b + B*a)*log(a*b*
sqrt(1/(a*b**3)) + x)/2

________________________________________________________________________________________